using System.Collections.Specialized;
using System.Configuration;
using System.Linq;
using Raven.Client;

namespace Mailias.UI.Web.Models
{
    public class HomeIndexViewModel
    {
        public string Title { get; set; }
        public string ServerName { get; set; }
        public string Hostname { get; set; }
        public string Message { get; set; }
        public int MessageCount { get; set; }
        public bool IsNotConfigured  { get; set; }

        public static HomeIndexViewModel Create()
        {
            var result = new HomeIndexViewModel
                             {
                                 Title = "Welcome to Mailias",
                                 Message =
                                     "This tool is used to provide SMTP services to a development team without sending SMTP mail to the internet."
                             };

            return result;
        }

        public static HomeIndexViewModel Create(IDocumentSession session)
        {
            var result = HomeIndexViewModel.Create();

            result.MessageCount = session.Query<Message>().Count();

            return result;
        }

    }
}